/*
 * XML Type:  Diagram
 * Namespace: http:///org/isistan/flabot/edit/editormodel.ecore
 * Java type: org.isistan.flabot.edit.editormodelEcore.Diagram
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.edit.editormodelEcore.impl;
/**
 * An XML Diagram(@http:///org/isistan/flabot/edit/editormodel.ecore).
 *
 * This is a complex type.
 */
public class DiagramImpl extends org.isistan.flabot.coremodelEcore.impl.NamedElementModelImpl implements org.isistan.flabot.edit.editormodelEcore.Diagram
{
    private static final long serialVersionUID = 1L;
    
    public DiagramImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName COREMODEL$0 = 
        new javax.xml.namespace.QName("", "coreModel");
    private static final javax.xml.namespace.QName NOTES$2 = 
        new javax.xml.namespace.QName("", "notes");
    private static final javax.xml.namespace.QName CHILDREN$4 = 
        new javax.xml.namespace.QName("", "children");
    private static final javax.xml.namespace.QName FOLDER$6 = 
        new javax.xml.namespace.QName("", "folder");
    private static final javax.xml.namespace.QName GRIDENABLED$8 = 
        new javax.xml.namespace.QName("", "gridEnabled");
    private static final javax.xml.namespace.QName SNAPTOGEOMETRYENABLED$10 = 
        new javax.xml.namespace.QName("", "snapToGeometryEnabled");
    private static final javax.xml.namespace.QName COREMODEL2$12 = 
        new javax.xml.namespace.QName("", "coreModel");
    private static final javax.xml.namespace.QName FOLDER2$14 = 
        new javax.xml.namespace.QName("", "folder");
    
    
    /**
     * Gets array of all "coreModel" elements
     */
    public org.isistan.flabot.coremodelEcore.CoreModel[] getCoreModelArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(COREMODEL2$12, targetList);
            org.isistan.flabot.coremodelEcore.CoreModel[] result = new org.isistan.flabot.coremodelEcore.CoreModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel getCoreModelArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().find_element_user(COREMODEL2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "coreModel" element
     */
    public int sizeOfCoreModelArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(COREMODEL2$12);
        }
    }
    
    /**
     * Sets array of all "coreModel" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setCoreModelArray(org.isistan.flabot.coremodelEcore.CoreModel[] coreModelArray)
    {
        check_orphaned();
        arraySetterHelper(coreModelArray, COREMODEL2$12);
    }
    
    /**
     * Sets ith "coreModel" element
     */
    public void setCoreModelArray(int i, org.isistan.flabot.coremodelEcore.CoreModel coreModel)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().find_element_user(COREMODEL2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(coreModel);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel insertNewCoreModel(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().insert_element_user(COREMODEL2$12, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel addNewCoreModel()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().add_element_user(COREMODEL2$12);
            return target;
        }
    }
    
    /**
     * Removes the ith "coreModel" element
     */
    public void removeCoreModel(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(COREMODEL2$12, i);
        }
    }
    
    /**
     * Gets array of all "notes" elements
     */
    public org.isistan.flabot.coremodelEcore.Note[] getNotesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(NOTES$2, targetList);
            org.isistan.flabot.coremodelEcore.Note[] result = new org.isistan.flabot.coremodelEcore.Note[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "notes" element
     */
    public org.isistan.flabot.coremodelEcore.Note getNotesArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Note target = null;
            target = (org.isistan.flabot.coremodelEcore.Note)get_store().find_element_user(NOTES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "notes" element
     */
    public int sizeOfNotesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(NOTES$2);
        }
    }
    
    /**
     * Sets array of all "notes" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setNotesArray(org.isistan.flabot.coremodelEcore.Note[] notesArray)
    {
        check_orphaned();
        arraySetterHelper(notesArray, NOTES$2);
    }
    
    /**
     * Sets ith "notes" element
     */
    public void setNotesArray(int i, org.isistan.flabot.coremodelEcore.Note notes)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Note target = null;
            target = (org.isistan.flabot.coremodelEcore.Note)get_store().find_element_user(NOTES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(notes);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "notes" element
     */
    public org.isistan.flabot.coremodelEcore.Note insertNewNotes(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Note target = null;
            target = (org.isistan.flabot.coremodelEcore.Note)get_store().insert_element_user(NOTES$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "notes" element
     */
    public org.isistan.flabot.coremodelEcore.Note addNewNotes()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Note target = null;
            target = (org.isistan.flabot.coremodelEcore.Note)get_store().add_element_user(NOTES$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "notes" element
     */
    public void removeNotes(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(NOTES$2, i);
        }
    }
    
    /**
     * Gets array of all "children" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.VisualModel[] getChildrenArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHILDREN$4, targetList);
            org.isistan.flabot.edit.editormodelEcore.VisualModel[] result = new org.isistan.flabot.edit.editormodelEcore.VisualModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "children" element
     */
    public org.isistan.flabot.edit.editormodelEcore.VisualModel getChildrenArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.VisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.VisualModel)get_store().find_element_user(CHILDREN$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "children" element
     */
    public int sizeOfChildrenArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHILDREN$4);
        }
    }
    
    /**
     * Sets array of all "children" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setChildrenArray(org.isistan.flabot.edit.editormodelEcore.VisualModel[] childrenArray)
    {
        check_orphaned();
        arraySetterHelper(childrenArray, CHILDREN$4);
    }
    
    /**
     * Sets ith "children" element
     */
    public void setChildrenArray(int i, org.isistan.flabot.edit.editormodelEcore.VisualModel children)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.VisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.VisualModel)get_store().find_element_user(CHILDREN$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(children);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "children" element
     */
    public org.isistan.flabot.edit.editormodelEcore.VisualModel insertNewChildren(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.VisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.VisualModel)get_store().insert_element_user(CHILDREN$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "children" element
     */
    public org.isistan.flabot.edit.editormodelEcore.VisualModel addNewChildren()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.VisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.VisualModel)get_store().add_element_user(CHILDREN$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "children" element
     */
    public void removeChildren(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHILDREN$4, i);
        }
    }
    
    /**
     * Gets array of all "folder" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.Folder[] getFolderArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(FOLDER2$14, targetList);
            org.isistan.flabot.edit.editormodelEcore.Folder[] result = new org.isistan.flabot.edit.editormodelEcore.Folder[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "folder" element
     */
    public org.isistan.flabot.edit.editormodelEcore.Folder getFolderArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.Folder target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.Folder)get_store().find_element_user(FOLDER2$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "folder" element
     */
    public int sizeOfFolderArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(FOLDER2$14);
        }
    }
    
    /**
     * Sets array of all "folder" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setFolderArray(org.isistan.flabot.edit.editormodelEcore.Folder[] folderArray)
    {
        check_orphaned();
        arraySetterHelper(folderArray, FOLDER2$14);
    }
    
    /**
     * Sets ith "folder" element
     */
    public void setFolderArray(int i, org.isistan.flabot.edit.editormodelEcore.Folder folder)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.Folder target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.Folder)get_store().find_element_user(FOLDER2$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(folder);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "folder" element
     */
    public org.isistan.flabot.edit.editormodelEcore.Folder insertNewFolder(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.Folder target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.Folder)get_store().insert_element_user(FOLDER2$14, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "folder" element
     */
    public org.isistan.flabot.edit.editormodelEcore.Folder addNewFolder()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.Folder target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.Folder)get_store().add_element_user(FOLDER2$14);
            return target;
        }
    }
    
    /**
     * Removes the ith "folder" element
     */
    public void removeFolder(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(FOLDER2$14, i);
        }
    }
    
    /**
     * Gets the "gridEnabled" attribute
     */
    public boolean getGridEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(GRIDENABLED$8);
            if (target == null)
            {
                return false;
            }
            return target.getBooleanValue();
        }
    }
    
    /**
     * Gets (as xml) the "gridEnabled" attribute
     */
    public org.apache.xmlbeans.XmlBoolean xgetGridEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(GRIDENABLED$8);
            return target;
        }
    }
    
    /**
     * True if has "gridEnabled" attribute
     */
    public boolean isSetGridEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(GRIDENABLED$8) != null;
        }
    }
    
    /**
     * Sets the "gridEnabled" attribute
     */
    public void setGridEnabled(boolean gridEnabled)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(GRIDENABLED$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(GRIDENABLED$8);
            }
            target.setBooleanValue(gridEnabled);
        }
    }
    
    /**
     * Sets (as xml) the "gridEnabled" attribute
     */
    public void xsetGridEnabled(org.apache.xmlbeans.XmlBoolean gridEnabled)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(GRIDENABLED$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_store().add_attribute_user(GRIDENABLED$8);
            }
            target.set(gridEnabled);
        }
    }
    
    /**
     * Unsets the "gridEnabled" attribute
     */
    public void unsetGridEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(GRIDENABLED$8);
        }
    }
    
    /**
     * Gets the "snapToGeometryEnabled" attribute
     */
    public boolean getSnapToGeometryEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SNAPTOGEOMETRYENABLED$10);
            if (target == null)
            {
                return false;
            }
            return target.getBooleanValue();
        }
    }
    
    /**
     * Gets (as xml) the "snapToGeometryEnabled" attribute
     */
    public org.apache.xmlbeans.XmlBoolean xgetSnapToGeometryEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(SNAPTOGEOMETRYENABLED$10);
            return target;
        }
    }
    
    /**
     * True if has "snapToGeometryEnabled" attribute
     */
    public boolean isSetSnapToGeometryEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(SNAPTOGEOMETRYENABLED$10) != null;
        }
    }
    
    /**
     * Sets the "snapToGeometryEnabled" attribute
     */
    public void setSnapToGeometryEnabled(boolean snapToGeometryEnabled)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SNAPTOGEOMETRYENABLED$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SNAPTOGEOMETRYENABLED$10);
            }
            target.setBooleanValue(snapToGeometryEnabled);
        }
    }
    
    /**
     * Sets (as xml) the "snapToGeometryEnabled" attribute
     */
    public void xsetSnapToGeometryEnabled(org.apache.xmlbeans.XmlBoolean snapToGeometryEnabled)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_attribute_user(SNAPTOGEOMETRYENABLED$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_store().add_attribute_user(SNAPTOGEOMETRYENABLED$10);
            }
            target.set(snapToGeometryEnabled);
        }
    }
    
    /**
     * Unsets the "snapToGeometryEnabled" attribute
     */
    public void unsetSnapToGeometryEnabled()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(SNAPTOGEOMETRYENABLED$10);
        }
    }
    
    /**
     * Gets the "coreModel" attribute
     */
    public java.lang.String getCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "coreModel" attribute
     */
    public org.apache.xmlbeans.XmlString xgetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COREMODEL2$12);
            return target;
        }
    }
    
    /**
     * True if has "coreModel" attribute
     */
    public boolean isSetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(COREMODEL2$12) != null;
        }
    }
    
    /**
     * Sets the "coreModel" attribute
     */
    public void setCoreModel2(java.lang.String coreModel2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(COREMODEL2$12);
            }
            target.setStringValue(coreModel2);
        }
    }
    
    /**
     * Sets (as xml) the "coreModel" attribute
     */
    public void xsetCoreModel2(org.apache.xmlbeans.XmlString coreModel2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(COREMODEL2$12);
            }
            target.set(coreModel2);
        }
    }
    
    /**
     * Unsets the "coreModel" attribute
     */
    public void unsetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(COREMODEL2$12);
        }
    }
    
    /**
     * Gets the "folder" attribute
     */
    public java.lang.String getFolder2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(FOLDER2$14);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "folder" attribute
     */
    public org.apache.xmlbeans.XmlString xgetFolder2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(FOLDER2$14);
            return target;
        }
    }
    
    /**
     * True if has "folder" attribute
     */
    public boolean isSetFolder2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(FOLDER2$14) != null;
        }
    }
    
    /**
     * Sets the "folder" attribute
     */
    public void setFolder2(java.lang.String folder2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(FOLDER2$14);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(FOLDER2$14);
            }
            target.setStringValue(folder2);
        }
    }
    
    /**
     * Sets (as xml) the "folder" attribute
     */
    public void xsetFolder2(org.apache.xmlbeans.XmlString folder2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(FOLDER2$14);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(FOLDER2$14);
            }
            target.set(folder2);
        }
    }
    
    /**
     * Unsets the "folder" attribute
     */
    public void unsetFolder2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(FOLDER2$14);
        }
    }
}
